﻿// Decompiled with JetBrains decompiler
// Type: System.Web.Razor.Generator.TypeMemberCodeGenerator
// Assembly: System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 682513D6-F37E-48AC-9909-F3EE103CFF14
// Assembly location: D:\Project\Idea\无人机外网\uav\客户端工程\排查工具\bin\Release\System.Web.Razor.dll

using System.CodeDom;
using System.Web.Razor.Parser.SyntaxTree;

namespace System.Web.Razor.Generator
{
  /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a type member code generator.</summary>
  public class TypeMemberCodeGenerator : SpanCodeGenerator
  {
    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Generates code with a given target and context.</summary>
    /// <param name="target">The target where to generate the code.</param>
    /// <param name="context">The code generator context.</param>
    public override void GenerateCode(Span target, CodeGeneratorContext context)
    {
      string code = context.BuildCodeString((Action<CodeWriter>) (cw => cw.WriteSnippet(target.Content)));
      int paddingCharCount;
      string text = CodeGeneratorPaddingHelper.Pad(context.Host, code, target, out paddingCharCount);
      CodeTypeMemberCollection members = context.GeneratedClass.Members;
      CodeSnippetTypeMember snippetTypeMember = new CodeSnippetTypeMember(text);
      snippetTypeMember.LinePragma = context.GenerateLinePragma(target, paddingCharCount);
      members.Add((CodeTypeMember) snippetTypeMember);
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns a string representation of this code.</summary>
    /// <returns>A string representation of this code.</returns>
    public override string ToString() => "TypeMember";

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object.</summary>
    /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
    /// <param name="obj">The object to compare to.</param>
    public override bool Equals(object obj) => obj is TypeMemberCodeGenerator;

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Retrieves the hash code for this current instance.</summary>
    /// <returns>The hash code for this current instance.</returns>
    public override int GetHashCode() => base.GetHashCode();
  }
}
